<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="./css/layui.css">
  <script src="./layui.js"></script>
  <script src="./js/jquery-3.5.1.js"></script>
  <title>Document</title>
</head>

<body>
    <blockquote class="layui-elem-quote" style="margin-top: 10px;">
        处方单
      </blockquote>
    <table class="layui-hide" id="test" lay-filter="test"></table>





    <form action="post" style="padding: 15px;">
    <div class="layui-form-item layui-form-text " style="padding-top: 12px;">
      <label class="layui-form-label">主诉：</label>
      <div class="layui-input-block">
        <textarea disabled="disabled" class="layui-textarea" id="bl_pillness"></textarea>
      </div>
    </div>
    <div class="layui-form-item layui-form-text " style="padding-top: 12px;">
      <label class="layui-form-label">既往病史及其他病史：</label>
      <div class="layui-input-block">
        <textarea disabled="disabled" class="layui-textarea" id="bl_fillness"></textarea>
      </div>
    </div>
    <div class="layui-form-item layui-form-text " style="padding-top: 12px;">
      <label class="layui-form-label">过敏史</label>
      <div class="layui-input-block">
        <textarea disabled="disabled" class="layui-textarea" id="bl_allergy"></textarea>
      </div>
    </div>
    <div class="layui-form-item layui-form-text " style="padding-top: 12px;">
      <label class="layui-form-label">望闻切诊</label>
      <div class="layui-input-block">
        <textarea disabled="disabled" class="layui-textarea" id="bl_symptom"></textarea>
      </div>
    </div>
    <div class="layui-form-item layui-form-text " style="padding-top: 12px;">
      <label class="layui-form-label">辅助检查</label>
      <div class="layui-input-block">
        <textarea  disabled="disabled"  class="layui-textarea" id="bl_assist"></textarea>
      </div>
    </div>
    <div class="layui-form-item layui-form-text " style="padding-top: 12px;">
      <label class="layui-form-label">诊断</label>
      <div class="layui-input-block">
        <textarea disabled="disabled" class="layui-textarea" id="bl_diag"></textarea>
      </div>
    </div>
    <div class="layui-form-item layui-form-text " style="padding-top: 12px;">
      <label class="layui-form-label">治疗意见</label>
      <div class="layui-input-block">
        <textarea disabled="disabled" class="layui-textarea" id="bl_suggestion"></textarea>
      </div>
    </div>
    <div class="layui-form-item layui-form-text " style="padding-top: 12px;">
      <label class="layui-form-label">病情变化及处置</label>
      <div class="layui-input-block">
        <textarea disabled="disabled" class="layui-textarea" id="bl_change"></textarea>
      </div>
    </div>
  </form>

    
 
       
        

        <hr>
        <hr>

      </div>
      <!-- 主体 -->

       <style>
         input::-webkit-input-placeholder {
            color:black;
          }
          input::-moz-input-placeholder {
            color:black;
          }
          input::-ms-input-placeholder {
            color:black;
          }
          textarea::-webkit-input-placeholder {
            color:black;
          }
          textarea::-moz-input-placeholder {
            color:black;
          }
          textarea::-ms-input-placeholder {
            color:black;
          }

          
       </style>




    <script>
      var a;
      layui.use('table', function(){
        var table = layui.table;

        table.render({
          elem: '#test'
          ,url:'/case/selectAdviceVO?bl_id='+bl_id   //数据来源接口
          ,title: '用户数据表'
          ,cols: [
            [  //表头
              {type: 'checkbox', fixed: 'left'}
              ,{field: 'yp_name', title: '药品', width:130, sort: true, fixed: 'left',align:"center" }
              ,{field: 'yp_standard', title: '药品规格', width:100,align:"center" }
                ,{field: 'yz_amount', title: '数量', width:100,align:"center" }
                ,{field: 'yz_dosage', title: '用法', width: 180,align:"center" }
            ]
          ]
          ,page: true
          ,parseData: function (res) {
            return {
              'code' : 0,
              'msg' : '',
              'count': res.length,
              'data':res
            }
          }
        });
      })
    </script>

    <script>
        var bl_id = getUrlParam('bl_id');
        $(function (){
            $.ajax({
                url: '/case/select',
                data: {'id': bl_id},
                method: 'POST',
                success:function (data){
                    console.log('a')
                    $("#bl_pillness").text(data.bl_pillness);
                    $("#bl_fillness").text(data.bl_fillness);
                    $("#bl_allergy").text(data.bl_allergy);
                    $("#bl_symptom").text(data.bl_symptom);
                    $("#bl_assist").text(data.bl_assist);
                    $("#bl_diag").text(data.bl_diag);
                    $("#bl_suggestion").text(data.bl_suggestion);
                    $("#bl_change").text(data.bl_change);
                }
            })
        });
        console.log('b')
        function getUrlParam(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return unescape(r[2]); return null;
        }
    </script>
</body>

</html>